package DaEr_5_25;

import java.util.ArrayList;

public class Manager extends User {
    public Manager() {
    }

    public Manager(String name, Integer money) {
        super(name, money);
    }
    public ArrayList<Integer> send(int totalmoney,int count){
        ArrayList<Integer> redlist = new ArrayList<>();
        Integer leftmoney = super.getMoney();
        if (totalmoney>leftmoney){
            System.out.println("余额不足");
            return redlist;
        }
        int avg=totalmoney/count;
        for (int i = 0; i < count-1; i++) {
            redlist.add(avg);
        }
        int last=avg+totalmoney%count;
        redlist.add(last);
            super.setMoney(leftmoney-totalmoney);
            return redlist;

    }

}
